package com.example.lrucache;

import java.util.Random;
import java.util.UUID;

class RandomUtil {

    private static final Random rnd = new Random();

    public static String randomString() {
        return UUID.randomUUID().toString();
    }

    public static String[] randomStrings(int num) {
        String[] array = new String[num];
        for (int i = 0; i < num; i++) {
            array[i] = randomString();
        }
        return array;
    }

    public static <T> T randomChoice(T[] array) {
        return array[randomInt(array.length)];
    }

    public static int randomInt(int max) {
        return rnd.nextInt(max);
    }
}
